import java.awt.image.BufferedImage;
import java.util.Objects;

/**
 * ClassName:Cell
 * Description:
 * author: jiuyang
 * DateTime: 2024/8/7 下午3:25
 */
public class Cell {

    private int row;
    private int col;
    private BufferedImage bufferedImage;

    public Cell() {
    }

    public Cell(int row, int col, BufferedImage bufferedImage) {
        this.row = row;
        this.col = col;
        this.bufferedImage = bufferedImage;
    }

    public int getRow() {
        return row;
    }

    public void setRow(int row) {
        this.row = row;
    }

    public int getCol() {
        return col;
    }

    public void setCol(int col) {
        this.col = col;
    }

    public BufferedImage getBufferedImage() {
        return bufferedImage;
    }

    public void setBufferedImage(BufferedImage bufferedImage) {
        this.bufferedImage = bufferedImage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Cell cell = (Cell) o;
        return row == cell.row && col == cell.col && Objects.equals(bufferedImage, cell.bufferedImage);
    }

    @Override
    public int hashCode() {
        return Objects.hash(row, col, bufferedImage);
    }

    @Override
    public String toString() {
        return "Cell{" +
                "row=" + row +
                ", col=" + col +
                ", bufferedImage=" + bufferedImage +
                '}';
    }

    public void left(){
        col--;
    }

    public void right() {
        col++;
    }
    public void drop(){
        row++;
    }
}
